#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <queue>
#include <cstring>

using namespace std;

int main(){
    string s;
    priority_queue<int,vector<int> , greater<int> > que;

    while (cin >>s &&s!="END"){
        int cnt[256];
        memset(cnt,0,sizeof(cnt));

        for (int i = 0 ; i < s.length();i++)
            cnt[s[i]]++;

        while (!que.empty()) que.pop();
        for (int i = 0 ; i<256 ; i++)
            if (cnt[i]) que.push(cnt[i]);

        int huf = 0;
        while (que.size()!=1){
            int nd = 0;
            nd+=que.top();
            que.pop();
            nd+=que.top();
            que.pop();
            que.push(nd);
            huf+=nd;
        }
        if (huf==0) huf = s.length();
        printf("%d %d %.1f\n",8*s.length() , huf, 8*s.length() * 1.0 / huf);
    }
    return 0;
}

